# #读文件
# f = open(r'test')
# f = open(r'D:\测试工具\python_pro\python_230901\homework\wangjiacheng\文件操作\test',mode='r',encoding='utf-8')
# data_discuz=f.read()
# print(data_discuz)
# f.close()
# print('==============='*2)
# #读文件（重点）
# with open(r'test')as  f:
#     data_discuz = f.read()
#     print(data_discuz)

# # 写文件
# with open(r'text.txt', mode='w')as f:
#     str = 'hellow tom!'
#     f.write(str)

# 复制一张图片
with open(r'001.jpg', mode='rb') as f1, open(r'001-1.jpg',mode='wb')as f2:
    data = f1.read()
    f2.write(data)